/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author 王宇
* @date 2023-10-19
**/
@Entity
@Data
@Table(name="course_clock_config")
public class CourseClockConfig implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "clock_config_id")
    @ApiModelProperty(value = "主键ID")
    private Long clockConfigId;

    @Column(name = "course_no")
    @ApiModelProperty(value = "课程编号")
    private String courseNo;

    @Column(name = "start_date")
    @ApiModelProperty(value = "打卡开始时间")
    private Timestamp startDate;

    @Column(name = "end_date")
    @ApiModelProperty(value = "打开结束时间")
    private Timestamp endDate;

    @Column(name = "visible_auth")
    @ApiModelProperty(value = "全员可见：0，班级可见：1")
    private Integer visibleAuth;

    @Column(name = "required_audit")
    @ApiModelProperty(value = "内容是否需要审核，0：不需要，1：需要")
    private Integer requiredAudit;

    @Column(name = "status")
    @ApiModelProperty(value = "状态，0：无效，1：有效")
    private Integer status;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "createby")
    @ApiModelProperty(value = "创建人")
    private String createby;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Column(name = "updateby")
    @ApiModelProperty(value = "更新人")
    private String updateby;

    @Column(name = "clock_rule")
    @ApiModelProperty(value = "打卡规则")
    private String clockRule;

    @Column(name = "course_name")
    @ApiModelProperty(value = "课程名称")
    private String courseName;

    public void copy(CourseClockConfig source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}